package com.jboost.hyk.clazz.entity;


import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.jboost.common.system.base.entity.JBoostEntity;

/**
 * @Description: 班级课程讲次
 * @Author: cxn
 * @Date:   2022-11-29
 * @Version: V1.0
 */
@Data
@TableName("hyk_class_course_lecture")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="hyk_class_course_lecture对象", description="班级课程讲次")
public class ClassCourseLecture extends JBoostEntity{

    @TableLogic
    /**delFlag*/
    @ApiModelProperty(value = "delFlag")
    private Integer delFlag;

    /**businessId*/
    @ApiModelProperty(value = "businessId")
    private String businessId;

    /**班级课程id*/
    @ApiModelProperty(value = "班级课程id")
    private String classCourseId;

    @ApiModelProperty(value = "班级id")
    private String classId;

    @ApiModelProperty(value = "班级课程名称")
    private String name;

    /**排序*/
    @ApiModelProperty(value = "排序")
    private Integer sort;

    /**知识点id用#分割*/
    @ApiModelProperty(value = "知识点id用#分割")
    private String pointIds;

    /**附件-讲义内容*/
    @ApiModelProperty(value = "附件-讲义内容")
    private String attachContent;

    /**作业标题*/
    @ApiModelProperty(value = "作业标题")
    private String workTitle;

    /**作业内容*/
    @ApiModelProperty(value = "作业内容")
    private String workContent;

    /**作业视频*/
    @ApiModelProperty(value = "作业视频")
    private String workVideoIds;

    /**作业图片*/
    @ApiModelProperty(value = "作业图片")
    private String workPictureIds;

    /**当前讲次上课时候学生的数量*/
    @ApiModelProperty(value = "当前讲次上课时候学生的数量")
    private Integer studentCount;

    /**已上课学生数量*/
    @ApiModelProperty(value = "已上课学生数量")
    private Integer completedCount;

    /**assignedCount*/
    @ApiModelProperty(value = "已布置作业的学生数量")
    private Integer assignedCount;

    /**上课时间*/
    @ApiModelProperty(value = "上课时间")
    private java.util.Date classTime;
    @ApiModelProperty(value = "上课状态：await-待上课；completed-已上课")
    private String classStatus;

    public void nullVal() {
        this.setId(null);
        this.setCreateBy(null);
        this.setCreateTime(null);
        this.setUpdateBy(null);
        this.setUpdateTime(null);
    }

    /**
     * 添加上课数量
     * @param num
     */
    public void completedNum(int num) {
        num += (null==this.completedCount?0:this.completedCount);
        if(num > this.studentCount){
            num = this.studentCount;
        }
        this.completedCount = num;
    }
    /**
     * 添加布置作业数量
     * @param num
     */
    public void assignedNum(int num) {
        num += (null==this.assignedCount?0:this.assignedCount);
        if(num > this.studentCount){
            num = this.studentCount;
        }
        this.assignedCount = num;
    }
}
